
package org.example.demo01.controller;

import org.example.demo01.dto.WorkStationQueueDTO;
import org.example.demo01.service.WorkStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test")
public class TestController {

    private final WorkStationService workStationService;

    @Autowired
    public TestController(WorkStationService workStationService) {
        this.workStationService = workStationService;
    }

    @GetMapping("/queue")
    public List<WorkStationQueueDTO> testQueue(@RequestParam String wsid) {
        return workStationService.getWorkstationQueueByid(wsid);
    }
}